﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace JXT.PrimaryKey.Batman.Language
{
    /// <summary>
    /// 通用语言接口
    /// </summary>
    public interface ILanguage
    {
        CultureInfo Culture { get; }

        /// <summary>
        /// 获取当前区域所有转换对象
        /// </summary>
        /// <returns>转换对象列表</returns>
        IEnumerable<Phrase> GetTranslations();

        /// <summary>
        /// 获取其他指定区域的所有转换对象
        /// </summary>
        /// <param name="culture">语言区域信息</param>
        /// <returns>转换对象列表</returns>
        IEnumerable<Phrase> GetTranslations(CultureInfo culture);

        /// <summary>
        /// 获取当前区域的个性化文字
        /// </summary>
        /// <param name="key">资源key</param>
        /// <returns>对应区域文字</returns>
        string Localize(string key);

        /// <summary>
        /// 获取其他指定区域个性化文字
        /// </summary>
        /// <param name="key">资源key</param>
        /// <param name="culture">语言区域信息</param>
        /// <returns>对应区域文字</returns>
        string Localize(string key, CultureInfo culture);

        /// <summary>
        /// 获取当前区域个性化区域文字
        /// </summary>
        /// <param name="key">资源key</param>
        /// <param name="defaultValue">默认值</param>
        /// <returns>对应区域文字</returns>
        string Localize(string key, string defaultValue);

        /// <summary>
        /// 获取其他指定区域个性化区域文字
        /// </summary>
        /// <param name="key">资源key</param>
        /// <param name="defaultValue">默认值</param>
        /// <param name="culture">语言区域信息</param>
        /// <returns>对应区域文字</returns>
        string Localize(string key, string defaultValue, CultureInfo culture);
    }
}
